package com.springboot.kafka.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

@Service
public class ProductConsumer {


    @KafkaListener(topics = {"product"})
    public void productConsumer(ConsumerRecord<String, String> record){

        System.out.println("接收到消息-");

        System.out.println("key= " + record.key());
        System.out.println("value= " + record.value());


    }

}
